import http from '@/http/http'
import api from '@/http/api'
export const files = {
    /**
     *  图片上传
     * url /api-file/files-anon
     * @param params 
     */
    uploadFile: async (params: any = {}, headers: any = {}) => {
        return await http.postFile(api.uploadFile, params, headers)
    },
    /**
     *  图片上传
     * url /api-file/files-anon
     * @param params 
     */
    uploadFileUn: async (params: any = {}, headers: any = {}) => {
        return await http.postFile(api.uploadFileUn, params, headers)
    },
    /**
     *  图片上传
     * url /api-file/files_base64
     * @param params 
     */
    uploadFileBase64: async (params: any = {}, headers: any = {}) => {
        return await http.post(api.files_base64, params, headers)
    },
    /**
     *  视频段剪辑推送
     * url /ffmpeg
     * @param params 
     */
    postFfmpeg: async (params: any = {}, headers: any = {}) => {
        return await http.post(api.ffmpeg, params, headers)
    },

    /**
     * 请求带过期时间图片路径 
     * url /api-file/add
     * @param params 
     */
    apiFileAdd: async (params: any = {}) => {
        let par: any = {};
        par.time = params.time ? params.time : '3600'
        return await http.get(api.apiFileAdd, par, {})
    },
}